\(\int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx\) [212]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 31, antiderivative size = 68 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {(2 c-d) d \text {arctanh}(\sin (e+f x))}{a f}+\frac {d^2 \tan (e+f x)}{a f}+\frac {(c-d)^2 \tan (e+f x)}{f (a+a \sec (e+f x))} \]

[Out]

(2*c-d)*d*arctanh(sin(f*x+e))/a/f+d^2*tan(f*x+e)/a/f+(c-d)^2*tan(f*x+e)/f/(a+a*sec(f*x+e))

Rubi [A] (verified)

Time = 0.17 (sec) , antiderivative size = 125, normalized size of antiderivative = 1.84, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4072, 91, 81, 65, 223, 209} \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {2 d (2 c-d) \tan (e+f x) \arctan \left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a (\sec (e+f x)+1)}}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a \sec (e+f x)+a}}+\frac {(c-d)^2 \tan (e+f x)}{f (a \sec (e+f x)+a)}+\frac {d^2 \tan (e+f x)}{a f} \]

[In]

Int[(Sec[e + f*x]*(c + d*Sec[e + f*x])^2)/(a + a*Sec[e + f*x]),x]

[Out]

(d^2*Tan[e + f*x])/(a*f) + ((c - d)^2*Tan[e + f*x])/(f*(a + a*Sec[e + f*x])) + (2*(2*c - d)*d*ArcTan[Sqrt[a -
a*Sec[e + f*x]]/Sqrt[a*(1 + Sec[e + f*x])]]*Tan[e + f*x])/(f*Sqrt[a - a*Sec[e + f*x]]*Sqrt[a + a*Sec[e + f*x]]
)

Rule 65

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, x]

Rule 81

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[b*(c + d*x)^
(n + 1)*((e + f*x)^(p + 1)/(d*f*(n + p + 2))), x] + Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1) + c*f*(p + 1)))/(
d*f*(n + p + 2)), Int[(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && NeQ[n + p + 2,
0]

Rule 91

Int[((a_.) + (b_.)*(x_))^2*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(b*c - a*d
)^2*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(d^2*(d*e - c*f)*(n + 1))), x] - Dist[1/(d^2*(d*e - c*f)*(n + 1)), In
t[(c + d*x)^(n + 1)*(e + f*x)^p*Simp[a^2*d^2*f*(n + p + 2) + b^2*c*(d*e*(n + 1) + c*f*(p + 1)) - 2*a*b*d*(d*e*
(n + 1) + c*f*(p + 1)) - b^2*d*(d*e - c*f)*(n + 1)*x, x], x], x] /; FreeQ[{a, b, c, d, e, f, n, p}, x] && (LtQ
[n, -1] || (EqQ[n + p + 3, 0] && NeQ[n, -1] && (SumSimplerQ[n, 1] ||  !SumSimplerQ[p, 1])))

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 223

Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a,
b}, x] &&  !GtQ[a, 0]

Rule 4072

Int[(csc[(e_.) + (f_.)*(x_)]*(g_.))^(p_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]
*(d_.) + (c_))^(n_), x_Symbol] :> Dist[a^2*g*(Cot[e + f*x]/(f*Sqrt[a + b*Csc[e + f*x]]*Sqrt[a - b*Csc[e + f*x]
])), Subst[Int[(g*x)^(p - 1)*(a + b*x)^(m - 1/2)*((c + d*x)^n/Sqrt[a - b*x]), x], x, Csc[e + f*x]], x] /; Free
Q[{a, b, c, d, e, f, g, m, n, p}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && (EqQ[p,
 1] || IntegerQ[m - 1/2])

Rubi steps \begin{align*} \text {integral}& = -\frac {\left (a^2 \tan (e+f x)\right ) \text {Subst}\left (\int \frac {(c+d x)^2}{\sqrt {a-a x} (a+a x)^{3/2}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {(c-d)^2 \tan (e+f x)}{f (a+a \sec (e+f x))}-\frac {\tan (e+f x) \text {Subst}\left (\int \frac {a^3 (2 c-d) d+a^3 d^2 x}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{a^2 f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {d^2 \tan (e+f x)}{a f}+\frac {(c-d)^2 \tan (e+f x)}{f (a+a \sec (e+f x))}-\frac {(a (2 c-d) d \tan (e+f x)) \text {Subst}\left (\int \frac {1}{\sqrt {a-a x} \sqrt {a+a x}} \, dx,x,\sec (e+f x)\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {d^2 \tan (e+f x)}{a f}+\frac {(c-d)^2 \tan (e+f x)}{f (a+a \sec (e+f x))}+\frac {(2 (2 c-d) d \tan (e+f x)) \text {Subst}\left (\int \frac {1}{\sqrt {2 a-x^2}} \, dx,x,\sqrt {a-a \sec (e+f x)}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {d^2 \tan (e+f x)}{a f}+\frac {(c-d)^2 \tan (e+f x)}{f (a+a \sec (e+f x))}+\frac {(2 (2 c-d) d \tan (e+f x)) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right )}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ & = \frac {d^2 \tan (e+f x)}{a f}+\frac {(c-d)^2 \tan (e+f x)}{f (a+a \sec (e+f x))}+\frac {2 (2 c-d) d \arctan \left (\frac {\sqrt {a-a \sec (e+f x)}}{\sqrt {a+a \sec (e+f x)}}\right ) \tan (e+f x)}{f \sqrt {a-a \sec (e+f x)} \sqrt {a+a \sec (e+f x)}} \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(237\) vs. \(2(68)=136\).

Time = 2.66 (sec) , antiderivative size = 237, normalized size of antiderivative = 3.49 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {2 \cos \left (\frac {1}{2} (e+f x)\right ) \cos (e+f x) (c+d \sec (e+f x))^2 \left ((c-d)^2 \sec \left (\frac {e}{2}\right ) \sin \left (\frac {f x}{2}\right )+d \cos \left (\frac {1}{2} (e+f x)\right ) \left (-\left ((2 c-d) \left (\log \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )\right )+\frac {d \sin (f x)}{\left (\cos \left (\frac {e}{2}\right )-\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {e}{2}\right )+\sin \left (\frac {e}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )}\right )\right )}{a f (d+c \cos (e+f x))^2 (1+\sec (e+f x))} \]

[In]

Integrate[(Sec[e + f*x]*(c + d*Sec[e + f*x])^2)/(a + a*Sec[e + f*x]),x]

[Out]

(2*Cos[(e + f*x)/2]*Cos[e + f*x]*(c + d*Sec[e + f*x])^2*((c - d)^2*Sec[e/2]*Sin[(f*x)/2] + d*Cos[(e + f*x)/2]*
(-((2*c - d)*(Log[Cos[(e + f*x)/2] - Sin[(e + f*x)/2]] - Log[Cos[(e + f*x)/2] + Sin[(e + f*x)/2]])) + (d*Sin[f
*x])/((Cos[e/2] - Sin[e/2])*(Cos[e/2] + Sin[e/2])*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])*(Cos[(e + f*x)/2] + Si
n[(e + f*x)/2])))))/(a*f*(d + c*Cos[e + f*x])^2*(1 + Sec[e + f*x]))

Maple [A] (verified)

Time = 0.71 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.51

method result size
parallelrisch \(\frac {-2 \left (c -\frac {d}{2}\right ) \cos \left (f x +e \right ) d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )+2 \left (c -\frac {d}{2}\right ) \cos \left (f x +e \right ) d \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )+\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) \left (\left (c^{2}-2 c d +2 d^{2}\right ) \cos \left (f x +e \right )+d^{2}\right )}{a f \cos \left (f x +e \right )}\) \(103\)
derivativedivides \(\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d +\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}-\frac {d^{2}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}-d \left (2 c -d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )-\frac {d^{2}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}+d \left (2 c -d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{f a}\) \(127\)
default \(\frac {\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c^{2}-2 \tan \left (\frac {f x}{2}+\frac {e}{2}\right ) c d +\tan \left (\frac {f x}{2}+\frac {e}{2}\right ) d^{2}-\frac {d^{2}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1}-d \left (2 c -d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )-\frac {d^{2}}{\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1}+d \left (2 c -d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{f a}\) \(127\)
norman \(\frac {\frac {\left (c^{2}-2 c d +d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{a f}+\frac {\left (c^{2}-2 c d +3 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}-\frac {2 \left (c^{2}-2 c d +2 d^{2}\right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{a f}}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2}-1\right )^{2}}+\frac {d \left (2 c -d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+1\right )}{a f}-\frac {d \left (2 c -d \right ) \ln \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}{a f}\) \(164\)
risch \(\frac {2 i \left (c^{2} {\mathrm e}^{2 i \left (f x +e \right )}-2 c d \,{\mathrm e}^{2 i \left (f x +e \right )}+d^{2} {\mathrm e}^{2 i \left (f x +e \right )}+d^{2} {\mathrm e}^{i \left (f x +e \right )}+c^{2}-2 c d +2 d^{2}\right )}{f a \left (1+{\mathrm e}^{2 i \left (f x +e \right )}\right ) \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )}+\frac {2 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right ) c}{a f}-\frac {d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}+i\right )}{a f}-\frac {2 d \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right ) c}{a f}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (f x +e \right )}-i\right )}{a f}\) \(195\)

[In]

int(sec(f*x+e)*(c+d*sec(f*x+e))^2/(a+a*sec(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

(-2*(c-1/2*d)*cos(f*x+e)*d*ln(tan(1/2*f*x+1/2*e)-1)+2*(c-1/2*d)*cos(f*x+e)*d*ln(tan(1/2*f*x+1/2*e)+1)+tan(1/2*
f*x+1/2*e)*((c^2-2*c*d+2*d^2)*cos(f*x+e)+d^2))/a/f/cos(f*x+e)

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 155 vs. \(2 (68) = 136\).

Time = 0.27 (sec) , antiderivative size = 155, normalized size of antiderivative = 2.28 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {{\left ({\left (2 \, c d - d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, c d - d^{2}\right )} \cos \left (f x + e\right )\right )} \log \left (\sin \left (f x + e\right ) + 1\right ) - {\left ({\left (2 \, c d - d^{2}\right )} \cos \left (f x + e\right )^{2} + {\left (2 \, c d - d^{2}\right )} \cos \left (f x + e\right )\right )} \log \left (-\sin \left (f x + e\right ) + 1\right ) + 2 \, {\left (d^{2} + {\left (c^{2} - 2 \, c d + 2 \, d^{2}\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{2 \, {\left (a f \cos \left (f x + e\right )^{2} + a f \cos \left (f x + e\right )\right )}} \]

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))^2/(a+a*sec(f*x+e)),x, algorithm="fricas")

[Out]

1/2*(((2*c*d - d^2)*cos(f*x + e)^2 + (2*c*d - d^2)*cos(f*x + e))*log(sin(f*x + e) + 1) - ((2*c*d - d^2)*cos(f*
x + e)^2 + (2*c*d - d^2)*cos(f*x + e))*log(-sin(f*x + e) + 1) + 2*(d^2 + (c^2 - 2*c*d + 2*d^2)*cos(f*x + e))*s
in(f*x + e))/(a*f*cos(f*x + e)^2 + a*f*cos(f*x + e))

Sympy [F]

\[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {\int \frac {c^{2} \sec {\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx + \int \frac {d^{2} \sec ^{3}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx + \int \frac {2 c d \sec ^{2}{\left (e + f x \right )}}{\sec {\left (e + f x \right )} + 1}\, dx}{a} \]

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))**2/(a+a*sec(f*x+e)),x)

[Out]

(Integral(c**2*sec(e + f*x)/(sec(e + f*x) + 1), x) + Integral(d**2*sec(e + f*x)**3/(sec(e + f*x) + 1), x) + In
tegral(2*c*d*sec(e + f*x)**2/(sec(e + f*x) + 1), x))/a

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 223 vs. \(2 (68) = 136\).

Time = 0.22 (sec) , antiderivative size = 223, normalized size of antiderivative = 3.28 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=-\frac {d^{2} {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {2 \, \sin \left (f x + e\right )}{{\left (a - \frac {a \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} - 2 \, c d {\left (\frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{a} - \frac {\sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} - \frac {c^{2} \sin \left (f x + e\right )}{a {\left (\cos \left (f x + e\right ) + 1\right )}}}{f} \]

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))^2/(a+a*sec(f*x+e)),x, algorithm="maxima")

[Out]

-(d^2*(log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/a - log(sin(f*x + e)/(cos(f*x + e) + 1) - 1)/a - 2*sin(f*x + e
)/((a - a*sin(f*x + e)^2/(cos(f*x + e) + 1)^2)*(cos(f*x + e) + 1)) - sin(f*x + e)/(a*(cos(f*x + e) + 1))) - 2*
c*d*(log(sin(f*x + e)/(cos(f*x + e) + 1) + 1)/a - log(sin(f*x + e)/(cos(f*x + e) + 1) - 1)/a - sin(f*x + e)/(a
*(cos(f*x + e) + 1))) - c^2*sin(f*x + e)/(a*(cos(f*x + e) + 1)))/f

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 136, normalized size of antiderivative = 2.00 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {\frac {{\left (2 \, c d - d^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1 \right |}\right )}{a} - \frac {{\left (2 \, c d - d^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1 \right |}\right )}{a} - \frac {2 \, d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )} a} + \frac {c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 2 \, c d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}{a}}{f} \]

[In]

integrate(sec(f*x+e)*(c+d*sec(f*x+e))^2/(a+a*sec(f*x+e)),x, algorithm="giac")

[Out]

((2*c*d - d^2)*log(abs(tan(1/2*f*x + 1/2*e) + 1))/a - (2*c*d - d^2)*log(abs(tan(1/2*f*x + 1/2*e) - 1))/a - 2*d
^2*tan(1/2*f*x + 1/2*e)/((tan(1/2*f*x + 1/2*e)^2 - 1)*a) + (c^2*tan(1/2*f*x + 1/2*e) - 2*c*d*tan(1/2*f*x + 1/2
*e) + d^2*tan(1/2*f*x + 1/2*e))/a)/f

Mupad [B] (verification not implemented)

Time = 13.53 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.25 \[ \int \frac {\sec (e+f x) (c+d \sec (e+f x))^2}{a+a \sec (e+f x)} \, dx=\frac {\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\,{\left (c-d\right )}^2}{a\,f}+\frac {2\,d^2\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}{f\,\left (a-a\,{\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^2\right )}+\frac {2\,d\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )\right )\,\left (2\,c-d\right )}{a\,f} \]

[In]

int((c + d/cos(e + f*x))^2/(cos(e + f*x)*(a + a/cos(e + f*x))),x)

[Out]

(tan(e/2 + (f*x)/2)*(c - d)^2)/(a*f) + (2*d^2*tan(e/2 + (f*x)/2))/(f*(a - a*tan(e/2 + (f*x)/2)^2)) + (2*d*atan
h(tan(e/2 + (f*x)/2))*(2*c - d))/(a*f)